// This file contains material supporting the textbook:
// "Object Oriented Software Engineering" and is issued under the open-source
// license found at www.lloseng.com

package com.drawpad;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

public class PadMouseAdapter extends MouseAdapter 
{
  DrawPad adaptee;

  public PadMouseAdapter(DrawPad adaptee) 
  {
    this.adaptee = adaptee;
  }

    @Override
  public void mouseReleased(MouseEvent e) 
  {
    adaptee.dragged = false;
    adaptee.handleRelease(e);
  }

    @Override
  public void mousePressed(MouseEvent e) 
  {
    adaptee.handleClick(e);
  }
}
